package org.dromara.quickswing.ui.app.page;

import org.dromara.quickswing.ui.app.QSPrefs;
import org.dromara.quickswing.ui.app.QSWidget;

import javax.swing.*;
import java.awt.*;

public abstract class QSPageItem<T extends QSWidget<? extends QSPrefs>> extends JPanel {

    public QSPageItem() {
        setLayout(new BorderLayout());
        setOpaque(false);
    }

    public abstract T getApp();

    public void setupUI() {
        onLoad();
        add(getContentPanel(), BorderLayout.CENTER);
    }

    public void onLoad() {

    }

    public void onChange() {

    }

    public void onClose() {

    }

    protected abstract JComponent getContentPanel();
}
